package String;

/**
 * 作者:TC
 * 时间:用户的登录的案列 8:32
 * 描述:没有bug
 */
import java.util.Scanner;
public class user {
    public static void main(String[] args) {
        String username="tc666";
        String passward="123456";
        for(int i=0;i<3;i++) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入用户名");
            String name = sc.nextLine();
            System.out.println("请输入账号密码");
            String pwd = sc.nextLine();
            if (name.equals(username) && pwd.equals(passward)) {
                System.out.println("登录成功");
                break;
            } else {
                if(2-i==0){
                    System.out.println("登录失败，系统锁定");
                }
                else
                {                System.out.println("您还有" + (2 - i) + "次机会");
            }
            }
        }

    }
}
